<% content_for :right do %>
<h5><%= _('Find a User') %></h5>

<% form_tag users_path, :method => 'get' do -%>
<p>
<label><%= _('Display name or login') %></label>
<%= text_field_tag :q, params[:q] %> 
<%= submit_tag _("Search") %></p>
<% end -%>

<% end -%>

<h1 style="margin-top:0;"><%= _('Users') %></h1>
<p class="subtitle">
<%= number_with_delimiter(@user_count) %> <%= _('users') %>, <%= @active %> <%= _('active') %>, <%= @user_count-@active %> <%= _('lurking') %>
</p>

<% if @user_pages.page_count > 1 -%>
<p class="pages"><%= _('Pages:') %> <strong><%= pagination_links @user_pages, :window_size => 10 %></strong></p>
<% end -%>

<table border="0" cellspacing="0" cellpadding="0" class="wide forums">
  <tr>
    <th class="la" width="88%"><%= _('Name / Login') %></th>
    <th><%= _('Website') %></th>
    <th width="5%"><%= _('Posts') %></th>
  </tr>
<% @users.each do |user|-%>  
  <tr>
    <td><%= link_to h(user.display_name), user_path(user), :class => (user.admin? ? "admin" : nil) %>
      <span style="color:#666">
      <%= _("(admin)") if user.admin? %>
      <%#= "(moderator)" unless user.moderatorships.empty? %>
      </span>
      </td>
    <td class="la">
      <% unless user.website.blank? %>
      <%= white_list link_to(user.website.gsub("http://",""), "http://" + user.website.gsub("http://","")) %>
      <% end %>
    </td>
    <td class="ca inv"><%= user.posts_count %></td>
  </tr>
<% end %>
</table>

<% if @user_pages and @user_pages.current.next %>
<p style="float:right;"><%= link_to _("Next page"), { :page => @user_pages.current.next }.merge(params.reject{|k,v| k=="page"})  %></p>
<% end %>

<% if @user_pages.page_count > 1 -%>
<p class="pages"><%= _('Pages:') %> <strong><%= pagination_links @user_pages, :window_size => 10 %></strong></p>
<% end -%>

